#include<stdio.h>
#include<math.h>
int main()
{
	long n;
	int sum = 0;
	printf("enter N: ");
	scanf("%ld" , &n);
	do
	{
		sum = sum + n%10;
		n = n/10;
	}while(n);
	printf("sum = %d\n",sum);
	return 0;
}